package crowx.android.AndCellTrack.BtsDB;

public class BtsInfo {
	//MCCMNC;CID;LAC;RNC;POS-LAT;POS-LON;POS-RAT;DESCRIPTION;RFU
	private int mccmnc = 0;
	private int cid = 0;
	private int lac = 0;
	private int rnc = 0;
	private double posLat = 0.0;
	private double posLon = 0.0;
	private int posRat = 0;	//??
	private String description = "";
	private int rfu = 0;
	
	public BtsInfo(String clfRecord) throws IllegalArgumentException {
		setFromCLFRecord(clfRecord);		
	}
	
	public void setFromCLFRecord(String clfRecord) throws IllegalArgumentException {
		String[] data = clfRecord.split(";");
		try {
			mccmnc = Integer.parseInt(data[0]);
			cid = Integer.parseInt(data[1]);
			lac = Integer.parseInt(data[2]);
			rnc = Integer.parseInt(data[3]);
			posLat = Double.parseDouble(data[4]);
			posLon = Double.parseDouble(data[5]);
			posRat = Integer.parseInt(data[6]);
			description = data[7];
			rfu = Integer.parseInt(data[8]);
		}
		catch(NumberFormatException e) {
			throw new IllegalArgumentException();
		}
	}
	
	public double[] getKey() {
		return new double[]{posLat,posLon};
	}

	public final int getMccmnc() {
		return mccmnc;
	}

	public final int getCid() {
		return cid;
	}

	public final int getLac() {
		return lac;
	}

	public final int getRnc() {
		return rnc;
	}

	public final double getPosLat() {
		return posLat;
	}

	public final double getPosLon() {
		return posLon;
	}

	public final int getPosRat() {
		return posRat;
	}

	public final String getDescription() {
		return description;
	}

	public final int getRfu() {
		return rfu;
	}

	public final void setMccmnc(int mccmnc) {
		this.mccmnc = mccmnc;
	}

	public final void setCid(int cid) {
		this.cid = cid;
	}

	public final void setLac(int lac) {
		this.lac = lac;
	}

	public final void setRnc(int rnc) {
		this.rnc = rnc;
	}

	public final void setPosLat(double posLat) {
		this.posLat = posLat;
	}

	public final void setPosLon(double posLon) {
		this.posLon = posLon;
	}

	public final void setPosRat(int posRat) {
		this.posRat = posRat;
	}

	public final void setDescription(String description) {
		this.description = description;
	}

	public final void setRfu(int rfu) {
		this.rfu = rfu;
	}
}
